

<!DOCTYPE html>
<html lang="en">
<head>

	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
	<meta name="apple-mobile-web-app-capable" content=true />
	<link rel="stylesheet" href="__PUBLIC__/com/jquery/jquery.mobile.min.css"/>
	<script src="__PUBLIC__/com/jquery/jquery.min.js"></script>
	<script src="__PUBLIC__/com/jquery/jquery.mobile.min.js"></script>

	<meta charset="utf-8">
	<title>发布App</title>
	<style type="text/css">

	</style>
</head>
<body align="center">
	<h1>jspatch</h1>

	<div data-role="page" id="pageSet">
		<div data-role="header">
			<!-- <a data-role="button" hidden=true></a> -->
			<h1>发布App</h1>
			<a href="javascript:history.back();">返回</a>
		</div>
		<div data-role="content">

			<iframe src="about:blank" name="blankFrame" id="blankFrame" style="display: none;"></iframe>
			<form action="./upload" method="post" align="left"
			enctype="multipart/form-data" target="blankFrame">
			<!-- <form action="/uploadfile/receiveFiles.php" method="post"
			enctype="multipart/form-data" target="blankFrame"> -->

			<br />

			安装包：
			<input type="hidden" name="MAX_FILE_SIZE" value="12800000000"> 
			<!-- <form action="/uploadfile/receiveFiles.php" method="post"
			enctype="multipart/form-data" target="blankFrame"> -->
			<br />
			<input class="upload"  multiple="multiple" type="file" name="file" id="file" /> 
			<!-- App名称:
			<input class="upload"  type="text" name="name" id="name" /> 
			版本号:
			<input class="upload"  type="text" name="version" id="version" /> 
			bundle-identifier:
			<input class="upload"  type="text" name="identifier" id="identifier" />  -->
			功能描述:
			<textarea type="text" name="description" id="description" style="height: 100pt;"></textarea> 
			<br />
			<br />
			<input class="btn_submit" type="submit" name="submit" value="提交" />

		</form>
		<!-- <button onclick="ajaxSend()">ajax提交</button> -->
	</div>
		<div data-role="footer" style="display: none;">
			<h1>e6jpfei</h1>
		</div>
		<style type="text/css">
			
	textarea.ui-input-text { min-height: 120pt;  }
		</style>
		<script type="text/javascript">
		function ajaxSend(){

		var fileObj = "";
		//document.getElementById('file').files[0];

		var blob = getBlob(fileObj);
		                  //downLoad.setAttribute('href',URL.createObjectURL(blob));
               var formFile = new FormData();
               formFile.append("action", "UploadVMKImagePath");  
               formFile.append("file", blob,"sss.jpg"); //加入文件对象

               var data = formFile;
               $.ajax({
                   url: "./upload_file.php",
                   data: data,
                   type: "Post",
                   dataType: "json",
                   cache: false,//上传文件无需缓存
                   processData: false,//用于对data参数进行序列化处理 这里必须false
                   contentType: false, //必须
                   success: function (result) {
                       alert("上传完成!");
                   }
               })
		}

        function getBlob(base64) {
            return b64toBlob(getData(base64), getContentType(base64));
        }          
        function getContentType(base64) {
            return /data:([^;]*);/i.exec(base64)[1];
        }
 
        function getData(base64) {
            return base64.substr(base64.indexOf("base64,") + 7, base64.length);
        }
        
        function b64toBlob(b64Data, contentType, sliceSize) {
            contentType = contentType || '';
            sliceSize = sliceSize || 512;
 
            var byteCharacters = atob(b64Data);
            var byteArrays = [];
 
            for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
                var slice = byteCharacters.slice(offset, offset + sliceSize);
 
                var byteNumbers = new Array(slice.length);
                for (var i = 0; i < slice.length; i++) {
                    byteNumbers[i] = slice.charCodeAt(i);
                }
 
                var byteArray = new Uint8Array(byteNumbers);
 
                byteArrays.push(byteArray);
            }
 
            var blob = new Blob(byteArrays, { type: contentType });
            return blob;
        }

		</script>
	</div>
</body>
</html>
